package com.example.scaletest.activity;

import android.app.Activity;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.example.scaletest.R;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;

public class MenuActivity extends Activity implements View.OnClickListener {


    private EditText accountEdit;
    private EditText passwordEdit;
    private Button good;
    private Button car;
    private Button warehouse;
    public String LOING_API ="http://10.103.246.33:8080/data/signIn";
    private HttpURLConnection conn = null;
    private String finalResult = "";
    private String result="";
    public static String firm_id=null;

    @Override
    protected void onCreate(Bundle savedInstanceState){
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.menu);
        good=(Button) findViewById(R.id.good);
        good.setOnClickListener(this);
        car=(Button) findViewById(R.id.car);
        car.setOnClickListener(this);
        warehouse=(Button) findViewById(R.id.warehouse);
        warehouse.setOnClickListener(this);
       // accountEdit = (EditText) findViewById(R.id.account);
      //  passwordEdit= (EditText) findViewById(R.id.password);
      //  login=(Button) findViewById(R.id.login);
      //  login.setOnClickListener(new View.OnClickListener() {
       //     @Override
        //    public void onClick(View v) {
//
      //      }
      //  });
    }

    @Override
    public void onClick(View v){
        switch(v.getId()){
            case R.id.good:
                Intent intent=new Intent(MenuActivity.this,MainActivity.class);
                startActivity(intent);
                break;
            case R.id.car:
                Intent intent1=new Intent(MenuActivity.this,CarActivity.class);
                startActivity(intent1);
                break;
            default:
                break;
        }

    }
}